home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / graphics / qcard / qcard.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-02-15  |  6.0 KB  |  145 lines

  1. {**********************************************************}
  2. {*                        QCARD.PAS                       *}
  3. {*            Compile this unit to interface              *}
  4. {*     QCARD.DLL Version 2.0 with Borland Pascal 7      *}
  5. {*          or Turbo Pascal for Windows 1.5             *}
  6. {**********************************************************}
  7.  
  8. UNIT QCARD;
  9.  
  10. INTERFACE
  11.  
  12. USES WinTypes;
  13.  
  14. CONST
  15.   CARDWIDTH    = 71;
  16.   CARDHEIGHT   = 96;
  17.   FACEUP       =  1;
  18.   FACEDOWN     =  0;
  19.   CARDOFFSET   = 16;
  20.  
  21.  {*** Procedures *************************************************}
  22.  
  23.   Procedure DrawCard(hWindow : HWnd; nCard, nxLoc, nyLoc : Integer);
  24.   Procedure DealCard(hWindow : HWnd; nCard, nx, ny: Integer);
  25.   Procedure DrawSymbol(hWindow : HWnd; nValue, nx, ny : Integer);
  26.   Procedure DrawBack(hWindow : HWnd; nValue, nx, ny : Integer);
  27.   Procedure RemoveCard(hWindow : HWnd; nCard: Integer);
  28.  
  29.   Procedure SetCardStatus(nCard : Integer; bStatus : Bool);
  30.   Procedure SetDefaultValues;
  31.   Procedure SetCurrentBack(nIndex : Integer);
  32.  
  33.   Procedure SetCardX(nCard, nx : Integer);
  34.   Procedure SetCardY(nCard, ny : Integer);
  35.   Procedure SetOffSet(nValue : Integer);
  36.  
  37.   Procedure SetUser1(nCard : Integer; nValue : Bool);
  38.   Procedure SetUser2(nCard, nValue : Integer);
  39.   Procedure SetUser3(nCard, nValue : Integer);
  40.   Procedure SetUser4(nCard, nValue : Integer);
  41.  
  42.   Procedure AdjustCardBlocked(nCard : Integer; bBlockFlag : Bool);
  43.   Procedure SetCardDisabled(nCard : Integer; bDisabledFlag : Bool);
  44.  
  45.   Procedure AbortDrag;
  46.   Procedure DoDrag(hWindow : HWnd; nx, ny : Integer);
  47.   Procedure ReturnDrag(hWindow : HWnd; nCard, nxLoc, nyLoc : Integer);
  48.   Procedure BlockDrag(hWindow : HWnd; CardList : Pointer;
  49.               nNumCards, nxLoc, nyLoc : Integer);
  50.   Procedure ReturnBlockDrag(hWindow : HWnd; CardList : Pointer;
  51.                             nNumCards, nxLoc, nyLoc : Integer);
  52.  
  53.  
  54.   {*** Functions *************************************************}
  55.  
  56.   Function  InitializeDeck(hWindow : HWnd) : Bool;
  57.  
  58.   Function  GetCardColor(nCard : Integer) : Integer;
  59.   Function  GetCardSuit(nCard : Integer) : Integer;
  60.   Function  GetCardValue(nCard : Integer) : Integer;
  61.  
  62.   Function  GetCardStatus(nCard : Integer) : Bool;
  63.  
  64.   Function  GetCardX(nCard : Integer) : Integer;
  65.   Function  GetCardY(nCard : Integer) : Integer;
  66.  
  67.   Function  GetUser1(nCard : Integer) : Bool;
  68.   Function  GetUser2(nCard : Integer) : Integer;
  69.   Function  GetUser3(nCard : Integer) : Integer;
  70.   Function  GetUser4(nCard : Integer) : Integer;
  71.  
  72.   Function  GetCardBlocked(nCard : Integer) : Bool;
  73.   Function  IsCardDisabled(nCard : Integer) : Bool;
  74.   
  75.   Function  InitDrag(hWindow : HWnd; nx, ny : Integer) : Integer;
  76.   Function  EndDrag(hWindow : HWnd; nx, ny : Integer) : Integer;
  77.   Function  EndBlockDrag(hWindow : HWnd; CardList : Pointer;
  78.              nNumCards, nxLoc, nyLoc : Integer) : Integer;
  79.  
  80.   Function  GetFreeDestination(nCard : Integer) : Integer;
  81.  
  82. {******************************************************}
  83. {*     Undocumented functions, generally not used     *}
  84. {******************************************************}
  85.  
  86.   { Manually sets the active drag card for}
  87.   { subsequent DoDrag or BlockDrag call.  }
  88.   Procedure SetActiveCard(nCard : Integer);
  89.  
  90.   { Returns the number of any unblocked card}
  91.   { which lies beneath the point nx, ny.    }
  92.   Function PointInFreeCard(nx, ny : Integer) : Integer;
  93.  
  94.   { returns the number of any card whose top 16 (or Offset)}
  95.   {  pixels lie beneath the point nx, ny.                  }
  96.   Function PointInCardTop(nx, ny : Integer) : Integer;
  97.  
  98. IMPLEMENTATION
  99.  
  100.   Procedure DrawCard;           external 'QCARD' index  2;
  101.   Procedure DrawBack;           external 'QCARD' index  3;
  102.   Procedure DrawSymbol;         external 'QCARD' index  4;
  103.   Procedure RemoveCard;             external 'QCARD' index  5;
  104.   Function  InitializeDeck;      external 'QCARD' index  6;
  105.   Procedure DealCard;             external 'QCARD' index  7;
  106.   Function  GetCardColor;         external 'QCARD' index  8;
  107.   Function  GetCardSuit;         external 'QCARD' index  9;
  108.   Function  GetCardValue;         external 'QCARD' index 10;
  109.   Function  GetCardStatus;        external 'QCARD' index 11;
  110.   Function  GetCardBlocked;       external 'QCARD' index 12;
  111.   Function  IsCardDisabled;       external 'QCARD' index 13;
  112.   Function  GetCardX;             external 'QCARD' index 14;
  113.   Function  GetCardY;             external 'QCARD' index 15;
  114.   Function  GetUser1;             external 'QCARD' index 16;
  115.   Function  GetUser2;             external 'QCARD' index 17;
  116.   Function  GetUser3;             external 'QCARD' index 18;
  117.   Function  GetUser4;             external 'QCARD' index 19;
  118.   Procedure SetCardStatus;        external 'QCARD' index 20;
  119.   Procedure AdjustCardBlocked;  external 'QCARD' index 21;
  120.   Procedure SetCardDisabled;    external 'QCARD' index 22;
  121.   Procedure SetCardX;        external 'QCARD' index 23;
  122.   Procedure SetCardY;        external 'QCARD' index 24;
  123.   Procedure SetUser1;        external 'QCARD' index 25;
  124.   Procedure SetUser2;        external 'QCARD' index 26;
  125.   Procedure SetUser3;        external 'QCARD' index 27;
  126.   Procedure SetUser4;        external 'QCARD' index 28;
  127.   Function  InitDrag;        external 'QCARD' index 29;
  128.   Function  PointInFreeCard;    external 'QCARD' index 30;
  129.   Procedure SetActiveCard;    external 'QCARD' index 31;
  130.   Procedure DoDrag;        external 'QCARD' index 32;
  131.   Function  EndDrag;        external 'QCARD' index 33;
  132.   Procedure ReturnDrag;        external 'QCARD' index 34;
  133.   Function  PointInCardTop;    external 'QCARD' index 35;
  134.   Procedure SetDefaultValues;   external 'QCARD' index 36;
  135.   Procedure BlockDrag;        external 'QCARD' index 37;
  136.   Function  EndBlockDrag;    external 'QCARD' index 38;
  137.   Procedure ReturnBlockDrag;    external 'QCARD' index 39;
  138.   Function  GetFreeDestination; external 'QCARD' index 40;
  139.   Procedure AbortDrag;        external 'QCARD' index 41;
  140.   Procedure SetCurrentBack;     external 'QCARD' index 42;
  141.   Procedure SetOffSet;        external 'QCARD' index 43;
  142. END.
  143. {**********************************************************}
  144. {*                 End of QCARD.PAS                       *}
  145. {**********************************************************}